import axios from 'axios'
export default {
  get: (param)=>{
    axios({
      url: param.url,
      method: param.method
    })
    .then(function (res) {
      param.callback(res)
    })
  },
  postAdmain: (param)=>{
    axios({
      url: 'http://139.224.132.124/fuxi-api/key-service',
      method: 'post',
      data: param.data,
      headers: {
        'Content-Type': 'application/json','token':localStorage.getItem('userToken')
      }
    })
    .then(function (res) {
      param.callback(res)
    })
  },
  postImg: (param)=>{
    axios({
      url: 'http://139.224.132.124/upload?h=400&w=500&type=2',
      method: 'post',
      data: param.data,
      headers: {
        'Content-Type': 'application/json'
      }
    })
      .then(function (res) {
        param.callback(res)
      })
  },
  post: (param)=>{
    axios({
      url: 'http://139.224.132.124/fuxi-api/mall-service',
      // url:'http://192.168.0.119:8769/fuxi-api/mall-service',
      method: 'post',
      data: param.data,
      headers: {
        'Content-Type': 'application/json','token':localStorage.getItem('userToken')
      }
    })
    .then(function (res) {
      param.callback(res)
    })
  }
}
